<div id="toTop" class="to-top" style="display: none;" onclick="scrollToTop()"><img class="to-top-icon" src="static/pic/wap/to_top.png" /></div>

<script type="text/javascript">
	var t1 = 0;
	var t2 = 0;
	var timer = null;

	document.onscroll = function() {
	    setDisplay('toTop', 'none');

	    clearTimeout(timer);
	    t1 = getScrollTop();
	    timer = setTimeout(isScrollEnd, 500);
	}

	function isScrollEnd() {
	    t2 = getScrollTop();
	    if (t2 == t1) {
	        if (t2 <= 0)
	            setDisplay('toTop', 'none');
	        else
	            setDisplay('toTop', '');
	    }
	}

	function getScrollTop() {
	    return document.documentElement.scrollTop || document.body.scrollTop;
	}

	function scrollToTop() {
	    var currentScroll = getScrollTop();
	    if (currentScroll > 1) {
	        window.requestAnimationFrame(scrollToTop);
	        window.scrollTo (0, currentScroll - (currentScroll / 5));
	    }
	    else {
	        window.scrollTo (0, 0);
	    }
	}
</script>

<style type="text/css">
	.to-top
	{
	    position: fixed;
	    bottom: 15%;
	    right: 5%;
	    z-index: 99;
	    width: 75px;
	    height: 75px;
	    -webkit-border-radius: 10px;
	}

	.to-top-icon
	{
	    width: 75px;
	    height: 75px;
	}
</style>